home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Testing & Debugging / Virtual User tools / SPEC S&L v.1.0.1 / Scripts / WordPerfect.vu < prev   
Encoding:
Text File  |  1993-12-17  |  7.9 KB  |  208 lines  |  [TEXT/MPS ]

  1. #
  2. # ****************************************************************************
  3. #
  4. #    File Name:        WordPerfect.vu
  5. #
  6. #    Contains:    Quick look test script for WordPerfect version 2.1
  7. #
  8. #    Written by:    Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
  9. #
  10. #    Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  11. #
  12. # ****************************************************************************
  13. #            C h a n g e        H i s t o r y (most recent first):
  14. # ****************************************************************************
  15. #
  16. #        Vers      Date        Author        Description
  17. #        ----    --------    ------    ---------------------------------------------
  18. #         <6>     9/30/93    KTA        Initialize gFileName prior to gApptitle being updated by
  19. #                                    launchTwitch().
  20. #         <3>     6/16/93    NAGA        Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
  21. #         <2>     5/26/93    NAGA        Set call to SuiteStart correctly
  22. #        <1+>     5/26/93    NAGA        Set call to SuiteStart correctly
  23. #        <1+>     5/25/93    NAGA        Adding header and porting old files to follow new standards
  24. #
  25. # ****************************************************************************
  26. #
  27.  
  28.  
  29.  
  30. ########################################################################
  31. #                            External libraries 
  32. #=======================================================================
  33. Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","WordProcessor.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
  34.  
  35.  
  36. #########################################################################
  37. ########               Application Specific Tasks
  38. #########################################################################
  39.  
  40. #########################################################################
  41. #                        InitAppGlobals()
  42. #========================================================================
  43. # Author:        ML
  44. # Description:    Sets up the tool palette for WordPerfect.  This task
  45. #                must be called first.
  46. # Parameters:    None
  47. # Returns:        Nothing
  48. # Examples:        InitAppGlobals()
  49. #========================================================================
  50. # History:
  51. #
  52. ########################################################################
  53. task InitAppGlobals()
  54. begin
  55.     
  56.     logstr("setting up {global gApptitle}'s globals");            
  57.     global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
  58.     global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
  59.     global kTabPaletteNum := 1; 
  60.     global kAlignPaletteNum := 2;
  61.     global kSpacingPaletteNum := 3;
  62.  
  63.     global gTextStr;
  64.     
  65.     global gPaletteList :=    {
  66.                             {                        #### Start Palette #1 - Tabs
  67.                             {25,31,13,24,0},        # Location of tab palette relative to the window
  68.                             kPopUpPal,                # Palette type
  69.                             {1,12},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  70.                             {0,13},                # Offset between tools {h,v}
  71.                             0,                        # Not used at this time
  72.                             0                        # Not used at this time
  73.                             },                        #### End Palette #1
  74.                             {                        #### Start Palette #2 - Alignment
  75.                             {71,31,54,24,0},        # Location of alignment palette relative to the window
  76.                             kPopUpPal,                # Palette type
  77.                             {1,5},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  78.                             {0,14},                # Offset between tools {h,v}
  79.                             0,                        # Not used at this time
  80.                             0                        # Not used at this time
  81.                             },                        #### End Palette #2
  82.                             {                        #### Start Palette #3 - Line spacing
  83.                             {253,31,234,24,0},        # Location of Line spacing palette relative to the window
  84.                             kPopUpPal,                # Palette type
  85.                             {1,3},                    # Size of Tool matrix {numElemsWide,numElemsTall}
  86.                             {0,14},                # Offset between tools {h,v}
  87.                             0,                        # Not used at this time
  88.                             0                        # Not used at this time
  89.                             }                        #### End Palette #3
  90.     };
  91.  
  92.     ### WordPerfect                                                                        {Flag, Pattern, Line, Color}
  93.     ### Palette Elements:=        Tool#, Pal#,     ToolName,     ToolType,    DblClktoEnd        SetAttributes
  94.     global TabLeftTool :=         { 1,  1,        "Tab Left",        kClick, 0,                {0}                };
  95.     global TabCenterTool :=     { 2,  1,        "Tab Center",    kClick, 0,                {0}                };
  96.     global TabRightTool :=         { 3,  1,        "Tab Right",    kClick, 0,                {0}                };
  97.     global TabDecimalTool :=     { 4,  1,        "Tab Decimal",    kClick, 0,                {0}                };
  98.     global TabDotLeftTool :=     { 5,  1,        "Tab Dot Left",    kClick, 0,                {0}                };
  99.     global TabDotCenterTool :=     { 6,  1,        "Tab Dot Center",kClick, 0,                {0}                };
  100.     global TabDotRightTool :=     { 7,  1,        "Tab Dot Right",kClick, 0,                {0}                };
  101.     global TabDotDecimalTool := { 8,  1,        "Tab Dot Decimal",kClick, 0,            {0}                };
  102.     global TabVerticalTool :=     { 9,  1,        "Tab Vertical",    kClick, 0,                {0}                };
  103.     global TabClearTool :=         {12,  1,        "Tab Clear",    0,         0,                {0}                };
  104.     global AlignLeftTool :=     { 1,  2,        "Align Left",    0,         0,                {0}                };
  105.     global AlignCenterTool :=     { 2,  2,        "Align Center",    0,         0,                {0}                };
  106.     global AlignRightTool :=     { 3,  2,        "Align Right",    0,         0,                {0}                };
  107.     global AlignJustifyTool :=     { 4,  2,        "Align Justify",0,         0,                {0}                };
  108.     global AlignJustifyAllTool :={ 5,  2,        "Align Justify All",0,     0,                {0}                };
  109.     global SingleSpaceTool :=     { 1,  3,        "Single Space",    0,         0,                {0}                };
  110.     global xSpaceTool :=         { 2,  3,        "1-1/2 Space",    0,         0,                {0}                };
  111.     global DoubleSpaceTool :=     { 3,  3,        "Double Space",    0,         0,                {0}                };
  112.     
  113.     global RulerRect:= {74,65,20,74};
  114.     
  115.     global RulerMenuPath := {'Show Ruler','Layout'};
  116.     
  117.     global TabToolList:={    TabClearTool,
  118.                             TabLeftTool,
  119.                             TabCenterTool,
  120.                             TabRightTool,
  121.                             TabDecimalTool,
  122.                             TabDotLeftTool,
  123.                             TabDotCenterTool,
  124.                             TabDotRightTool,
  125.                             TabDotDecimalTool,
  126.                             TabVerticalTool
  127.     };
  128.  
  129.     global OtherToolList:={    AlignLeftTool,
  130.                             AlignCenterTool,
  131.                             AlignRightTool,
  132.                             AlignJustifyTool,
  133.                             AlignJustifyAllTool,
  134.                             SingleSpaceTool,
  135.                             xSpaceTool,
  136.                             DoubleSpaceTool
  137.     };
  138.     
  139.         ### font characteristic lists
  140.     global gFontList := {'Helvetica','Courier','Chicago'};
  141.     global gFontSizeList := {'9','10','12','14','18', '24'};
  142.     global gFontStyleList := {'Bold','Italics','Outline', 'Underline','Shadow',
  143.                             'Superscript','Subscript','Redline'};
  144.  
  145.     
  146.         ### Name of the Plain (style) menu item  ####
  147.     global gPlainStyle := "Plain Text";            # Plain-Style menu item
  148.  
  149.         ### How to get to the next line
  150.     global gNextLineMethod := 1;            
  151.         ### 1 - ReturnKey,  2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
  152.     
  153.         ### Does moving to the next line clear all font info
  154.     global gNextLineClearsFontSettings := 0;                        
  155.  
  156. end;    #InitAppGlobals
  157.  
  158. #########################################################################
  159. #                            Views()
  160. #========================================================================
  161. # Author:        Jon Marsh x2 8093
  162. # Description:    Change views.
  163. # Parameters:    None
  164. # Returns:        Nothing
  165. # Examples:        Views();
  166. # Assumptions:    None 
  167. # Applications:        WordPerfect
  168. #========================================================================
  169. # History:
  170. #
  171. ########################################################################
  172. task Views() begin
  173.     LogStr( "Changing Views");
  174.     SelectMenuItem("Show ¶", "Edit");
  175.     SelectMenuItem("Show Codes", "Edit");
  176.     SelectMenuItem("Show Clipboard", "Edit");
  177.     CloseWindow();
  178.     SelectMenuItem("Hide ¶", "Edit");
  179.     SelectMenuItem("Hide Codes", "Edit");
  180. end;
  181.  
  182. ################################################################################
  183. ####################             Main script                    ####################
  184. ################################################################################
  185. script WordPerfect (ScriptLevel:= -1)
  186. begin
  187.     InitGlobals(ScriptLevel);
  188.     InitDraw();
  189.     InitFonts();
  190.     global gAppTitle := 'WordPerfect';
  191.     global gAppVersion := '2';        # version of app you will be running
  192.     global gFileName := "@!@-{gBuildVers}-{gAppTitle}";    #This is used in SaveAs when saving files
  193.     SuiteStart('WordPerfect.vu');                    # begin a new test suite
  194.     if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
  195.     begin
  196.         InitAppGlobals();
  197.         (*
  198.         *)
  199.         DoSetUpApp(1,,,,1,1);
  200.         DoText();
  201.         if (gAppTestLevel = 2)
  202.             DoWPTools();
  203.         Views();
  204.         DoWindow();
  205.         DoCloseApp();
  206.     end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
  207.     SuiteEnd();
  208. end; # script WordPerfect